{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "7005e4a0",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'nt'"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import os\n",
    "os.name"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "ac3be243",
   "metadata": {},
   "outputs": [],
   "source": [
    "import platform \n",
    "info = platform.uname()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "5f5926ca",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "uname_result(system='Windows', node='thoams', release='10', version='10.0.22631', machine='AMD64')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "info"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "97a1abbe",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "environ{'ALLUSERSPROFILE': 'C:\\\\ProgramData',\n",
       "        'APPCODE_VM_OPTIONS': 'D:\\\\Package\\\\jetbra\\\\vmoptions\\\\appcode.vmoptions',\n",
       "        'APPDATA': 'C:\\\\Users\\\\10767\\\\AppData\\\\Roaming',\n",
       "        'AQUA_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\aqua.vmoptions',\n",
       "        'CLASSPATH': '.;D:\\\\Software\\\\Java\\\\jdk1.8.0_202\\\\lib\\\\dt.jar;D:\\\\Software\\\\Java\\\\jdk1.8.0_202\\\\lib\\\\tools.jar;',\n",
       "        'CLION_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\clion.vmoptions',\n",
       "        'COMMONPROGRAMFILES': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMMONPROGRAMFILES(X86)': 'C:\\\\Program Files (x86)\\\\Common Files',\n",
       "        'COMMONPROGRAMW6432': 'C:\\\\Program Files\\\\Common Files',\n",
       "        'COMPUTERNAME': 'THOAMS',\n",
       "        'COMSPEC': 'C:\\\\Windows\\\\system32\\\\cmd.exe',\n",
       "        'CONDA_DEFAULT_ENV': 'chatgpt',\n",
       "        'CONDA_EXE': 'D:\\\\ProgramData\\\\anaconda3\\\\Scripts\\\\conda.exe',\n",
       "        'CONDA_PREFIX': 'C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt',\n",
       "        'CONDA_PREFIX_1': 'D:\\\\ProgramData\\\\anaconda3',\n",
       "        'CONDA_PROMPT_MODIFIER': '(chatgpt) ',\n",
       "        'CONDA_PYTHON_EXE': 'D:\\\\ProgramData\\\\anaconda3\\\\python.exe',\n",
       "        'CONDA_SHLVL': '2',\n",
       "        'DATAGRIP_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\datagrip.vmoptions',\n",
       "        'DATASPELL_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\dataspell.vmoptions',\n",
       "        'DEVECOSTUDIO_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\devecostudio.vmoptions',\n",
       "        'DRIVERDATA': 'C:\\\\Windows\\\\System32\\\\Drivers\\\\DriverData',\n",
       "        'EFC_8956': '1',\n",
       "        'GATEWAY_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\gateway.vmoptions',\n",
       "        'GOLAND_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\goland.vmoptions',\n",
       "        'HOMEDRIVE': 'C:',\n",
       "        'HOMEPATH': '\\\\Users\\\\10767',\n",
       "        'IDEA_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\idea.vmoptions',\n",
       "        'JAVA_HOME': 'D:\\\\Software\\\\Java\\\\jdk1.8.0_202',\n",
       "        'JETBRAINSCLIENT_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\jetbrainsclient.vmoptions',\n",
       "        'JETBRAINS_CLIENT_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\jetbrains_client.vmoptions',\n",
       "        'LOCALAPPDATA': 'C:\\\\Users\\\\10767\\\\AppData\\\\Local',\n",
       "        'LOGONSERVER': '\\\\\\\\THOAMS',\n",
       "        'MAVEN_HOME': 'D:\\\\Software\\\\maven-3.8.8',\n",
       "        'NUMBER_OF_PROCESSORS': '16',\n",
       "        'NVM_HOME': 'D:\\\\Software\\\\nvm\\\\nvm',\n",
       "        'NVM_SYMLINK': 'D:\\\\Program Files\\\\nodejs',\n",
       "        'ONEDRIVE': 'C:\\\\Users\\\\10767\\\\OneDrive',\n",
       "        'ONEDRIVECONSUMER': 'C:\\\\Users\\\\10767\\\\OneDrive',\n",
       "        'OPENAI_API_KEY': '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',\n",
       "        'OS': 'Windows_NT',\n",
       "        'PATH': 'C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt;C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\Library\\\\mingw-w64\\\\bin;C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\Library\\\\usr\\\\bin;C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\Library\\\\bin;C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\Scripts;C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\bin;D:\\\\ProgramData\\\\anaconda3\\\\condabin;C:\\\\Program Files (x86)\\\\Common Files\\\\Oracle\\\\Java\\\\javapath;C:\\\\Windows\\\\system32;C:\\\\Windows;C:\\\\Windows\\\\System32\\\\Wbem;C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0;C:\\\\Windows\\\\System32\\\\OpenSSH;C:\\\\Program Files\\\\Docker\\\\Docker\\\\resources\\\\bin;D:\\\\Software\\\\Java\\\\jdk1.8.0_202\\\\bin;D:\\\\Software\\\\Java\\\\jdk1.8.0_202\\\\jre\\\\bin;D:\\\\Software\\\\maven-3.8.8\\\\bin;D:\\\\Software\\\\maven-3.8.8\\\\bin;d:\\\\Program Files\\\\Git\\\\cmd;D:\\\\Program Files\\\\python2.7;C:\\\\Users\\\\10767\\\\AppData\\\\Roaming\\\\npm\\\\node_modules\\\\@vue\\\\cli-init\\\\node_modules\\\\.bin;D:\\\\Software\\\\allure-2.29.0\\\\bin;D:\\\\Software\\\\nvm\\\\nvm;D:\\\\Program Files\\\\nodejs;D:\\\\ProgramData\\\\anaconda3;D:\\\\ProgramData\\\\anaconda3\\\\Scripts;D:\\\\ProgramData\\\\anaconda3\\\\Library\\\\bin;D:\\\\ProgramData\\\\anaconda3\\\\Library\\\\mingw-w64\\\\bin;C:\\\\Users\\\\10767\\\\AppData\\\\Local\\\\Microsoft\\\\WindowsApps;D:\\\\Software\\\\VScode\\\\Microsoft VS Code\\\\bin;C:\\\\Users\\\\10767\\\\AppData\\\\Roaming\\\\npm;D:\\\\Software\\\\nvm\\\\nvm;D:\\\\Program Files\\\\nodejs;d:\\\\Program Files\\\\JetBrains\\\\PyCharm 2024.1.6\\\\bin;.',\n",
       "        'PATHEXT': '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.CPL',\n",
       "        'PHPSTORM_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\phpstorm.vmoptions',\n",
       "        'PROCESSOR_ARCHITECTURE': 'AMD64',\n",
       "        'PROCESSOR_IDENTIFIER': 'AMD64 Family 25 Model 68 Stepping 1, AuthenticAMD',\n",
       "        'PROCESSOR_LEVEL': '25',\n",
       "        'PROCESSOR_REVISION': '4401',\n",
       "        'PROGRAMDATA': 'C:\\\\ProgramData',\n",
       "        'PROGRAMFILES': 'C:\\\\Program Files',\n",
       "        'PROGRAMFILES(X86)': 'C:\\\\Program Files (x86)',\n",
       "        'PROGRAMW6432': 'C:\\\\Program Files',\n",
       "        'PSMODULEPATH': 'C:\\\\Users\\\\10767\\\\Documents\\\\WindowsPowerShell\\\\Modules;C:\\\\Program Files\\\\WindowsPowerShell\\\\Modules;C:\\\\Windows\\\\system32\\\\WindowsPowerShell\\\\v1.0\\\\Modules',\n",
       "        'PUBLIC': 'C:\\\\Users\\\\Public',\n",
       "        'PYCHARM': 'd:\\\\Program Files\\\\JetBrains\\\\PyCharm 2024.1.6\\\\bin;',\n",
       "        'PYCHARM_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\pycharm.vmoptions',\n",
       "        'RIDER_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\rider.vmoptions',\n",
       "        'ROCKETMQ_HOME': 'D:\\\\Software\\\\rocketmq-4.9.4\\\\bin',\n",
       "        'RUBYMINE_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\rubymine.vmoptions',\n",
       "        'RUSTROVER_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\rustrover.vmoptions',\n",
       "        'SESSIONNAME': 'Console',\n",
       "        'SSL_CERT_FILE': 'C:\\\\Users\\\\10767\\\\.conda\\\\envs\\\\chatgpt\\\\Library\\\\ssl\\\\cacert.pem',\n",
       "        'STUDIO_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\studio.vmoptions',\n",
       "        'SYSTEMDRIVE': 'C:',\n",
       "        'SYSTEMROOT': 'C:\\\\Windows',\n",
       "        'TEMP': 'C:\\\\Users\\\\10767\\\\AppData\\\\Local\\\\Temp',\n",
       "        'TMP': 'C:\\\\Users\\\\10767\\\\AppData\\\\Local\\\\Temp',\n",
       "        'USERDOMAIN': 'THOAMS',\n",
       "        'USERDOMAIN_ROAMINGPROFILE': 'THOAMS',\n",
       "        'USERNAME': '10767',\n",
       "        'USERPROFILE': 'C:\\\\Users\\\\10767',\n",
       "        'WEBIDE_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\webide.vmoptions',\n",
       "        'WEBSTORM_VM_OPTIONS': 'C:\\\\Users\\\\10767\\\\Downloads\\\\jetbra-pycharm\\\\jetbra\\\\vmoptions\\\\webstorm.vmoptions',\n",
       "        'WINDIR': 'C:\\\\Windows',\n",
       "        '_CONDA_EXE': 'D:\\\\ProgramData\\\\anaconda3\\\\Scripts\\\\conda.exe',\n",
       "        '_CONDA_ROOT': 'D:\\\\ProgramData\\\\anaconda3',\n",
       "        '__CONDA_OPENSLL_CERT_FILE_SET': '1',\n",
       "        'PYDEVD_USE_FRAME_EVAL': 'NO',\n",
       "        'JPY_INTERRUPT_EVENT': '4728',\n",
       "        'IPY_INTERRUPT_EVENT': '4728',\n",
       "        'JPY_PARENT_PID': '5032',\n",
       "        'TERM': 'xterm-color',\n",
       "        'CLICOLOR': '1',\n",
       "        'FORCE_COLOR': '1',\n",
       "        'CLICOLOR_FORCE': '1',\n",
       "        'PAGER': 'cat',\n",
       "        'GIT_PAGER': 'cat',\n",
       "        'MPLBACKEND': 'module://matplotlib_inline.backend_inline'}"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.environ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "d3a44822",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\ProgramData\\\\anaconda3\\\\Scripts\\\\conda.exe'"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.environ.get('CONDA_EXE', 'default')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "id": "a14cb636",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO'"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.abspath('.')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "id": "26cab3ea",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\testdir'"
      ]
     },
     "execution_count": 10,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.join('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO', 'testdir')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "id": "b60fc538",
   "metadata": {},
   "outputs": [],
   "source": [
    "os.mkdir('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\testdir')\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "id": "da2dd0c9",
   "metadata": {},
   "outputs": [],
   "source": [
    "os.rmdir('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\testdir')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "9df51dda",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO', 'testdir')"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.split('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\testdir')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "id": "67438e1d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\test', '.txt')"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.path.splitext('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base\\\\IO\\\\test.txt')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 22,
   "id": "cf878b3d",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['.ipynb_checkpoints']"
      ]
     },
     "execution_count": 22,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[x for x in os.listdir('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base') if os.path.isdir(x)]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "id": "4e6c1b42",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['.ipynb_checkpoints',\n",
       " 'AdvanceCharacter',\n",
       " 'AdvanceClassObject',\n",
       " 'ClassOject',\n",
       " 'DataType.ipynb',\n",
       " 'DictAndSet.ipynb',\n",
       " 'Error',\n",
       " 'function',\n",
       " 'IO',\n",
       " 'ListAndDuple.ipynb',\n",
       " 'ModelPaternt.ipynb',\n",
       " 'StringAndUnicode.ipynb']"
      ]
     },
     "execution_count": 23,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "os.listdir('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 28,
   "id": "aa167313",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[]"
      ]
     },
     "execution_count": 28,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "[x for x in os.listdir('D:\\\\Worker\\\\Code\\\\python\\\\python\\\\01_Base') if os.path.isfile(x) and os.path.splitext(x)[1]=='.ipynb']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "id": "c0bf6f4b",
   "metadata": {},
   "outputs": [
    {
     "ename": "SyntaxError",
     "evalue": "incomplete input (520366049.py, line 1)",
     "output_type": "error",
     "traceback": [
      "\u001b[1;36m  Cell \u001b[1;32mIn[30], line 1\u001b[1;36m\u001b[0m\n\u001b[1;33m    [x for x in os.listdir('.')\u001b[0m\n\u001b[1;37m                                ^\u001b[0m\n\u001b[1;31mSyntaxError\u001b[0m\u001b[1;31m:\u001b[0m incomplete input\n"
     ]
    }
   ],
   "source": [
    "[x for x in os.listdir('.') "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f23c6795",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
